package com.zy.xuanwo.zyc.portal.parser.imp;


import com.zy.xuanwo.zyc.portal.bean.ScheduleCreat;
import com.zy.xuanwo.zyc.portal.parser.BaseParser;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * remarks:
 * Created by ChowYvlChen on 2016/7/6  17:05
 */
public class ScheduleCreateParser extends BaseParser<ScheduleCreat> {
    @Override
    public ScheduleCreat parserJSON(String jsonStr) throws JSONException {
        ScheduleCreat scheduleCreat = null;
        if (super.ParseResultPoly(jsonStr) == null) {
            scheduleCreat = new ScheduleCreat();
            JSONObject mJSONObject = new JSONObject(jsonStr);
            if (mJSONObject.has("result")) {
                scheduleCreat.setResult(mJSONObject.getString("result"));
            }
            if (mJSONObject.has("schedule_id")) {
                scheduleCreat.setSchedule_id(mJSONObject.getString("schedule_id"));
            }
        }
        return scheduleCreat;
    }
}
